import greenfoot.*;  // (World, Actor, GreenfootImage, Greenfoot and MouseInfo)

/**
 * objeto a recolectar 1
 */
public class objeto1 extends objetos
{
    public void act() 
    {
        // Add your action code here.
        space w = (space)getWorld();
        MueveEnemigo();
    }  
    public void MueveEnemigo()
    {
        int yAux,xAux,i=0;
        int x = Greenfoot.getRandomNumber(3);
        yAux=getY()+1;
        xAux=getX()+1;
        if(yAux >= getWorld().getHeight()-1)
        {
             if(x==1)
             setLocation(getX()+30,yAux);
             
             if(x==2)
             setLocation(getX()-30,yAux);
             
            yAux=0;
        }
       
        setLocation(getX(),yAux);
        
     }    
}
